package com.daedalus.ushtrimePrintimi.tipikeMeYje;/*
 * Created with IntelliJ IDEA.
 * Author: Kostika Gorica
 * Date: 12-11-18
 * Time: 6.09.MD
 */

import javax.swing.*;

public class RombiInversAvancuar {

    public static void main(String[] args){
        String strNoShtylla= JOptionPane.showInputDialog(null,"Jep numrin e Yjeve ne rreshtin e pare:");
        int noShtylla = Integer.parseInt(strNoShtylla);
        int noYje = noShtylla/2;
        int noSpace = 0;
        boolean  first=true;

        do{
            for (int i=0; i<noYje; i++){
                System.out.print("*");
            }
            for (int i=0; i<noSpace; i++){
                System.out.print(" ");
            }
            for (int i=0; i<noYje; i++){
                System.out.print("*");
            }
            System.out.println();

            if(noYje==1){
                first = false;
            }
            if(first){
                noSpace+=2;
                noYje--;
            }else {
                noSpace-=2;
                noYje++;
            }
        }while (noYje<=noShtylla/2);
    }
}
